<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>route - ClueLib</title><link rel="stylesheet" type="text/css" href="../styles/main.css"><script language=JavaScript src="../javascript/main.js"></script><script language=JavaScript src="../javascript/prettify.js"></script></head><body class="FramedContentPage" onLoad="NDOnLoad();prettyPrint();"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>

<!--  Generated by Natural Docs, version 1.52 -->
<!--  http://www.naturaldocs.org  -->

<!-- saved from url=(0026)http://www.naturaldocs.org -->




<div id=Content><div class="CClass"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="route"></a>route</h1><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>class route #(</td><td class="PType  prettyprint " nowrap>type&nbsp;</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> int</td><td class="PAfterParameters  prettyprint "nowrap>) extends collection#( T )</td></tr></table></td></tr></table></blockquote><p>Implements a route structure.</p><h4 class=CHeading>Parameter</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>T</td><td class=CDLDescription><span class="optional">optional</span> The type of data collected in a route.&nbsp; The default is <b>int</b>.</td></tr></table><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#route" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">route</a></td><td class=SDescription>Implements a route structure.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#route.Types" >Types</a></td><td class=SDescription></td></tr><tr class="SType SIndent2 SMarked"><td class=SEntry><a href="#route.route_node_type" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">route_node_type</a></td><td class=SDescription>The shorthand of the <a href="cl_route_node-svh.html#route_node" class=LClass id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">route_node</a> type specialized with type <b>T</b>.</td></tr><tr class="SType SIndent2"><td class=SEntry><a href="#route.route_type" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">route_type</a></td><td class=SDescription>The shorthand of the <a href="#route" class=LClass id=link5 onMouseOver="ShowTip(event, 'tt1', 'link5')" onMouseOut="HideTip('tt1')">route</a> type specialized with type <b>T</b>.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#route.Properties" >Properties</a></td><td class=SDescription></td></tr><tr class="SProperty SIndent2 SMarked"><td class=SEntry><a href="#route.start" id=link6 onMouseOver="ShowTip(event, 'tt5', 'link6')" onMouseOut="HideTip('tt5')">start</a></td><td class=SDescription>The starting node of the route.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#route.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#route.new" id=link7 onMouseOver="ShowTip(event, 'tt6', 'link7')" onMouseOut="HideTip('tt6')">new</a></td><td class=SDescription>Creates a new route.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#route.add" id=link8 onMouseOver="ShowTip(event, 'tt7', 'link8')" onMouseOut="HideTip('tt7')">add</a></td><td class=SDescription><span class="virtual">virtual</span> Creates a new <a href="cl_route_node-svh.html#route_node" class=LClass id=link9 onMouseOver="ShowTip(event, 'tt3', 'link9')" onMouseOut="HideTip('tt3')">route_node</a> of the given element and adds it to the <a href="#route.start" class=LProperty id=link10 onMouseOver="ShowTip(event, 'tt5', 'link10')" onMouseOut="HideTip('tt5')">start</a>. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#route.add_to_node" id=link11 onMouseOver="ShowTip(event, 'tt8', 'link11')" onMouseOut="HideTip('tt8')">add_to_node</a></td><td class=SDescription><span class="virtual">virtual</span> Creates a new <a href="cl_route_node-svh.html#route_node" class=LClass id=link12 onMouseOver="ShowTip(event, 'tt3', 'link12')" onMouseOut="HideTip('tt3')">route_node</a> of the given element and adds it to the specified <b>node</b>.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#route.connect" id=link13 onMouseOver="ShowTip(event, 'tt9', 'link13')" onMouseOut="HideTip('tt9')">connect</a></td><td class=SDescription><span class="virtual">virtual</span> Connects the given two <a href="cl_route_node-svh.html#route_node" class=LClass id=link14 onMouseOver="ShowTip(event, 'tt3', 'link14')" onMouseOut="HideTip('tt3')">route_node</a>s.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#route.clear" id=link15 onMouseOver="ShowTip(event, 'tt10', 'link15')" onMouseOut="HideTip('tt10')">clear</a></td><td class=SDescription><span class="virtual">virtual</span> Removes all of the elements from this route.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#route.clone" id=link16 onMouseOver="ShowTip(event, 'tt11', 'link16')" onMouseOut="HideTip('tt11')">clone</a></td><td class=SDescription><span class="virtual">virtual</span> Returns a shallow copy of this route. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#route.is_empty" id=link17 onMouseOver="ShowTip(event, 'tt12', 'link17')" onMouseOut="HideTip('tt12')">is_empty</a></td><td class=SDescription><span class="virtual">virtual</span> Returns 1 if this route contains no elements.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#route.get_iterator" id=link18 onMouseOver="ShowTip(event, 'tt13', 'link18')" onMouseOut="HideTip('tt13')">get_iterator</a></td><td class=SDescription><span class="virtual">virtual</span> Returns an iterator over the elements in this route. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#route.get_breadth_first_iterator" id=link19 onMouseOver="ShowTip(event, 'tt14', 'link19')" onMouseOut="HideTip('tt14')">get_breadth_first_iterator</a></td><td class=SDescription><span class="virtual">virtual</span> Returns a <a href="cl_route_breadth_first_iterator-svh.html#route_breadth_first_iterator" class=LClass id=link20 onMouseOver="ShowTip(event, 'tt15', 'link20')" onMouseOut="HideTip('tt15')">route_breadth_first_iterator</a> over the elements in this route.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#route.get_last_node" id=link21 onMouseOver="ShowTip(event, 'tt16', 'link21')" onMouseOut="HideTip('tt16')">get_last_node</a></td><td class=SDescription><span class="virtual">virtual</span> Returns the last route node in the breadth-first order.</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="route.Types"></a>Types</h3></div></div>

<div class="CType"><div class=CTopic><h3 class=CTitle><a name="route.route_node_type"></a>route_node_type</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>typedef route_node#(</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PAfterParameters  prettyprint "nowrap>) route_node_type</td></tr></table></td></tr></table></blockquote><p>The shorthand of the <a href="cl_route_node-svh.html#route_node" class=LClass id=link22 onMouseOver="ShowTip(event, 'tt3', 'link22')" onMouseOut="HideTip('tt3')">route_node</a> type specialized with type <b>T</b>.</p></div></div></div>

<div class="CType"><div class=CTopic><h3 class=CTitle><a name="route.route_type"></a>route_type</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>typedef route#(</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PAfterParameters  prettyprint "nowrap>) route_type</td></tr></table></td></tr></table></blockquote><p>The shorthand of the <a href="#route" class=LClass id=link23 onMouseOver="ShowTip(event, 'tt1', 'link23')" onMouseOut="HideTip('tt1')">route</a> type specialized with type <b>T</b>.</p></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="route.Properties"></a>Properties</h3></div></div>

<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="route.start"></a>start</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">route_node_type start</td></tr></table></blockquote><p>The starting node of the route.</p></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="route.Functions"></a>Functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="route.new"></a>new</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>function new(</td><td class="PType  prettyprint " nowrap>collection#(T)&nbsp;</td><td class="PParameter  prettyprint " nowrap>c</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> null,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>comparator#(T)&nbsp;</td><td class="PParameter  prettyprint " nowrap>cmp</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> null,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>formatter#(T)&nbsp;</td><td class="PParameter  prettyprint " nowrap>fmtr</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> null</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates a new route.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>c</td><td class=CDLDescription><span class="optional">optional</span> A collection whose elements are to be added to this route.</td></tr><tr><td class=CDLEntry>cmp</td><td class=CDLDescription><span class="optional">optional</span> A strategy object used to compare the elements of type <b>T</b>.&nbsp; If not specified or <b>null</b>, <a href="cl_comparator-svh.html#comparator" class=LClass id=link24 onMouseOver="ShowTip(event, 'tt17', 'link24')" onMouseOut="HideTip('tt17')">comparator</a> <b>#(T)</b> is used.&nbsp; The default is <b>null</b>.</td></tr><tr><td class=CDLEntry>fmtr</td><td class=CDLDescription><span class="optional">optional</span> A strategy object that provides a function to convert the element of type <b>T</b> to a string.&nbsp; If not specified or <b>null</b>, <a href="cl_hex_formatter-svh.html#hex_formatter" class=LClass id=link25 onMouseOver="ShowTip(event, 'tt18', 'link25')" onMouseOut="HideTip('tt18')">hex_formatter</a> <b>#(T)</b> is used.&nbsp; The default is <b>null</b>.</td></tr></table><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">route#(int) int_route = new();</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="route.add"></a>add</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function bit add(</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="virtual">virtual</span> Creates a new <a href="cl_route_node-svh.html#route_node" class=LClass id=link26 onMouseOver="ShowTip(event, 'tt3', 'link26')" onMouseOut="HideTip('tt3')">route_node</a> of the given element and adds it to the <a href="#route.start" class=LProperty id=link27 onMouseOver="ShowTip(event, 'tt5', 'link27')" onMouseOut="HideTip('tt5')">start</a>.&nbsp;  If the <a href="#route.start" class=LProperty id=link28 onMouseOver="ShowTip(event, 'tt5', 'link28')" onMouseOut="HideTip('tt5')">start</a> is empty, make the newly created <a href="cl_route_node-svh.html#route_node" class=LClass id=link29 onMouseOver="ShowTip(event, 'tt3', 'link29')" onMouseOut="HideTip('tt3')">route_node</a> as the starting node.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>e</td><td class=CDLDescription>An element to be added to the <a href="#route.start" class=LProperty id=link30 onMouseOver="ShowTip(event, 'tt5', 'link30')" onMouseOut="HideTip('tt5')">start</a>.</td></tr></table><h4 class=CHeading>Returns</h4><p>If this route changed as a result of the call, 1 is returned.&nbsp; Otherwise, 0 is returned.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">route#(int) int_route = new();

assert( int_route.add( 123 ) );
// (123)
//   \__ starting node

assert( int_route.add( 234 ) );
// (123) ---- (234)

assert( int_route.add( 345 ) );
// (123) -+-- (234)
//        |
//        +-- (345)</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="route.add_to_node"></a>add_to_node</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function route_node_type add_to_node(</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>route_node_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>node</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> null</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="virtual">virtual</span> Creates a new <a href="cl_route_node-svh.html#route_node" class=LClass id=link31 onMouseOver="ShowTip(event, 'tt3', 'link31')" onMouseOut="HideTip('tt3')">route_node</a> of the given element and adds it to the specified <b>node</b>.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>e</td><td class=CDLDescription>An element to be added to the route.</td></tr><tr><td class=CDLEntry>node</td><td class=CDLDescription><span class="optional">optional</span> The node the newly created <a href="cl_route_node-svh.html#route_node" class=LClass id=link32 onMouseOver="ShowTip(event, 'tt3', 'link32')" onMouseOut="HideTip('tt3')">route_node</a> is connected to.&nbsp; If the <b>node</b> is <b>null</b>, add the node to the <a href="#route.start" class=LProperty id=link33 onMouseOver="ShowTip(event, 'tt5', 'link33')" onMouseOut="HideTip('tt5')">start</a>.&nbsp; If the <a href="#route.start" class=LProperty id=link34 onMouseOver="ShowTip(event, 'tt5', 'link34')" onMouseOut="HideTip('tt5')">start</a> is empty, make the newly created <a href="cl_route_node-svh.html#route_node" class=LClass id=link35 onMouseOver="ShowTip(event, 'tt3', 'link35')" onMouseOut="HideTip('tt3')">route_node</a> as the starting node.&nbsp; Default is <b>null</b>.</td></tr></table><h4 class=CHeading>Returns</h4><p>Newly added <a href="cl_route_node-svh.html#route_node" class=LClass id=link36 onMouseOver="ShowTip(event, 'tt3', 'link36')" onMouseOut="HideTip('tt3')">route_node</a>.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">route#(int)      int_route = new();
route_node#(int) rn_123;
route_node#(int) rn_234;
route_node#(int) rn_345;

rn_123 = int_route.add_to_node( 123 );
// (123)
//   \__ starting node

rn_234 = int_route.add_to_node( 234, .node( rn_123 ) );
// (123) ---- (234)

rn_345 = int_route.add_to_node( 345, .node( rn_234 ) );
// (123) ---- (234) ---- (345)</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="route.connect"></a>connect</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function route_node_type connect(</td><td class="PType  prettyprint " nowrap>route_node_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>from_node,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>route_node_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>to_node</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="virtual">virtual</span> Connects the given two <a href="cl_route_node-svh.html#route_node" class=LClass id=link37 onMouseOver="ShowTip(event, 'tt3', 'link37')" onMouseOut="HideTip('tt3')">route_node</a>s.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>from_node</td><td class=CDLDescription>A route node connected from.</td></tr><tr><td class=CDLEntry>to_node</td><td class=CDLDescription>A route node connected to.</td></tr></table><h4 class=CHeading>Returns</h4><p>A route node connected to (<b>to_node</b>).</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">route#(int)      int_route = new();
route_node#(int) rn;
route_node#(int) rn_123;
route_node#(int) rn_234;
route_node#(int) rn_345;
route_node#(int) rn_456;

rn_123 = int_route.add_to_node( 123 );
rn_234 = int_route.add_to_node( 234, .node( rn_123 ) );
// (123) ---- (234)
//              \__ rn_234

rn_345 = new( 345 );
rn_456 = rn_345.add( 456 );
// (345) ---- (456)
//   \__ rn_345

rn = int_route.connect( .from_node( rn_234 ), .to_node( rn_345 ) );
// (123) ---- (234) ---- (345) --- (456)
//                         \__ rn</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="route.clear"></a>clear</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">virtual function void clear()</td></tr></table></blockquote><p><span class="virtual">virtual</span> Removes all of the elements from this route.</p><h4 class=CHeading>Returns</h4><p>None.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">route#(int) int_route = new();

assert( int_route.add( 123 ) );
assert( int_route.add( 234 ) );
assert( int_route.size() == 2 );
int_route.clear();
assert( int_route.size() == 0 );</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="route.clone"></a>clone</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function collection#(</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PAfterParameters  prettyprint "nowrap>) clone()</td></tr></table></td></tr></table></blockquote><p><span class="virtual">virtual</span> Returns a shallow copy of this route.&nbsp; Only the <a href="#route.start" class=LProperty id=link38 onMouseOver="ShowTip(event, 'tt5', 'link38')" onMouseOut="HideTip('tt5')">start</a> is copied.&nbsp; The connected routes are not cloned.</p><h4 class=CHeading>Returns</h4><p>A copy of this route.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">route#(int) int_route = new();
collection#(int) cloned;

assert( int_route.add( 123 ) );
assert( int_route.add( 234 ) );
cloned = int_route.clone();
assert( cloned.size() == 2 );</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="route.is_empty"></a>is_empty</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">virtual function bit is_empty()</td></tr></table></blockquote><p><span class="virtual">virtual</span> Returns 1 if this route contains no elements.</p><h4 class=CHeading>Returns</h4><p>If this route contains no elements, returns 1.&nbsp; Otherwise, returns 0.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">route#(int) int_route = new();

assert( int_route.add( 123 ) );
assert( int_route.add( 234 ) );
assert( int_route.is_empty() == 0 );</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="route.get_iterator"></a>get_iterator</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function iterator#(</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PAfterParameters  prettyprint "nowrap>) get_iterator()</td></tr></table></td></tr></table></blockquote><p><span class="virtual">virtual</span> Returns an iterator over the elements in this route.&nbsp; This function is equivalent to <a href="#route.get_breadth_first_iterator" class=LFunction id=link39 onMouseOver="ShowTip(event, 'tt14', 'link39')" onMouseOut="HideTip('tt14')">get_breadth_first_iterator</a>.</p><h4 class=CHeading>Returns</h4><p>An iterator.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">route#(int)      int_route = new();
route_node#(int) rn_123;
route_node#(int) rn_234;
route_node#(int) rn_345;
route_node#(int) rn_456;
iterator#(int)  it;
string s;

rn_123 = int_route.add_to_node( 123 );
rn_234 = int_route.add_to_node( 234, .node( rn_123 ) );
rn_345 = int_route.add_to_node( 345, .node( rn_123 ) );
rn_456 = int_route.add_to_node( 456, .node( rn_234 ) );
// (123) -+-- (234) ---- (456)
//        |
//        +-- (345)

it = int_route.get_iterator();
while ( it.has_next() ) s = { s, $sformatf( &quot;%0d &quot;, it.next() ) };
assert( s == &quot;123 234 345 456 &quot; );</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="route.get_breadth_first_iterator"></a>get_breadth_first_iterator</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function iterator#(</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PAfterParameters  prettyprint "nowrap>) get_breadth_first_iterator()</td></tr></table></td></tr></table></blockquote><p><span class="virtual">virtual</span> Returns a <a href="cl_route_breadth_first_iterator-svh.html#route_breadth_first_iterator" class=LClass id=link40 onMouseOver="ShowTip(event, 'tt15', 'link40')" onMouseOut="HideTip('tt15')">route_breadth_first_iterator</a> over the elements in this route.</p><h4 class=CHeading>Returns</h4><p>An iterator.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">route#(int)      int_route = new();
route_node#(int) rn_123;
route_node#(int) rn_234;
route_node#(int) rn_345;
route_node#(int) rn_456;
iterator#(int)  it;
string s;

rn_123 = int_route.add_to_node( 123 );
rn_234 = int_route.add_to_node( 234, .node( rn_123 ) );
rn_345 = int_route.add_to_node( 345, .node( rn_123 ) );
rn_456 = int_route.add_to_node( 456, .node( rn_234 ) );
// (123) -+-- (234) ---- (456)
//        |
//        +-- (345)

it = int_route.get_breadth_first_iterator();
while ( it.has_next() ) s = { s, $sformatf( &quot;%0d &quot;, it.next() ) };
assert( s == &quot;123 234 345 456 &quot; );</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="route.get_last_node"></a>get_last_node</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">virtual function route_node_type get_last_node()</td></tr></table></blockquote><p><span class="virtual">virtual</span> Returns the last route node in the breadth-first order.</p><h4 class=CHeading>Returns</h4><p>The last node.&nbsp; If the last route node does not exist, return <b>null</b>.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">route#(int) int_route = new();
assert( int_route.add( 123 ) );
assert( int_route.add( 234 ) );

assert( int_route.get_last_node().elem == 234 );</pre></blockquote></div></div></div>

</div><!--Content-->



<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CClass><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>class route #(</td><td class="PType  prettyprint " nowrap>type&nbsp;</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> int</td><td class="PAfterParameters  prettyprint "nowrap>) extends collection#( T )</td></tr></table></td></tr></table></blockquote>Implements a route structure.</div></div><div class=CToolTip id="tt2"><div class=CType><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>typedef route_node#(</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PAfterParameters  prettyprint "nowrap>) route_node_type</td></tr></table></td></tr></table></blockquote>The shorthand of the route_node type specialized with type <b>T</b>.</div></div><div class=CToolTip id="tt3"><div class=CClass><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>class route_node #(</td><td class="PType  prettyprint " nowrap>type&nbsp;</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> int</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Implements a node of a route.</div></div><div class=CToolTip id="tt4"><div class=CType><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>typedef route#(</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PAfterParameters  prettyprint "nowrap>) route_type</td></tr></table></td></tr></table></blockquote>The shorthand of the route type specialized with type <b>T</b>.</div></div><div class=CToolTip id="tt5"><div class=CProperty><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">route_node_type start</td></tr></table></blockquote>The starting node of the route.</div></div><div class=CToolTip id="tt6"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>function new(</td><td class="PType  prettyprint " nowrap>collection#(T)&nbsp;</td><td class="PParameter  prettyprint " nowrap>c</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> null,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>comparator#(T)&nbsp;</td><td class="PParameter  prettyprint " nowrap>cmp</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> null,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>formatter#(T)&nbsp;</td><td class="PParameter  prettyprint " nowrap>fmtr</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> null</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Creates a new route.</div></div><div class=CToolTip id="tt7"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function bit add(</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="virtual">virtual</span> Creates a new route_node of the given element and adds it to the start. </div></div><div class=CToolTip id="tt8"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function route_node_type add_to_node(</td><td class="PType  prettyprint " nowrap>T&nbsp;</td><td class="PParameter  prettyprint " nowrap>e,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>route_node_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>node</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> null</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="virtual">virtual</span> Creates a new route_node of the given element and adds it to the specified <b>node</b>.</div></div><div class=CToolTip id="tt9"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function route_node_type connect(</td><td class="PType  prettyprint " nowrap>route_node_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>from_node,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>route_node_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>to_node</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="virtual">virtual</span> Connects the given two route_nodes.</div></div><div class=CToolTip id="tt10"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">virtual function void clear()</td></tr></table></blockquote><span class="virtual">virtual</span> Removes all of the elements from this route.</div></div><div class=CToolTip id="tt11"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function collection#(</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PAfterParameters  prettyprint "nowrap>) clone()</td></tr></table></td></tr></table></blockquote><span class="virtual">virtual</span> Returns a shallow copy of this route. </div></div><div class=CToolTip id="tt12"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">virtual function bit is_empty()</td></tr></table></blockquote><span class="virtual">virtual</span> Returns 1 if this route contains no elements.</div></div><div class=CToolTip id="tt13"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function iterator#(</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PAfterParameters  prettyprint "nowrap>) get_iterator()</td></tr></table></td></tr></table></blockquote><span class="virtual">virtual</span> Returns an iterator over the elements in this route. </div></div><div class=CToolTip id="tt14"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>virtual function iterator#(</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PAfterParameters  prettyprint "nowrap>) get_breadth_first_iterator()</td></tr></table></td></tr></table></blockquote><span class="virtual">virtual</span> Returns a route_breadth_first_iterator over the elements in this route.</div></div><div class=CToolTip id="tt15"><div class=CClass><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>class route_breadth_first_iterator #(</td><td class="PType  prettyprint " nowrap>type&nbsp;</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> int</td><td class="PAfterParameters  prettyprint "nowrap>) extends iterator#( T )</td></tr></table></td></tr></table></blockquote>Provides a breadth-first iterator to a route.</div></div><div class=CToolTip id="tt16"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">virtual function route_node_type get_last_node()</td></tr></table></blockquote><span class="virtual">virtual</span> Returns the last route node in the breadth-first order.</div></div><div class=CToolTip id="tt17"><div class=CClass><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>class comparator#(</td><td class="PType  prettyprint " nowrap>type&nbsp;</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> int</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="singleton">singleton</span> Provides strategies to compare objects.</div></div><div class=CToolTip id="tt18"><div class=CClass><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>class hex_formatter #(</td><td class="PType  prettyprint " nowrap>type&nbsp;</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> int</td><td class="PAfterParameters  prettyprint "nowrap>) extends formatter#( T )</td></tr></table></td></tr></table></blockquote><span class="singleton">singleton</span> Provides a strategy to convert an object of type <b>T</b> to a string using a hexadecimal format.</div></div><!--END_ND_TOOLTIPS-->

<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>